var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var UI_BoxUpLevel_UIBindings = require("AA_UI_BoxUpLevel_UIBindings");
var UIView = require("AA_UIView");
var Excel = require("AA_Excel");
var HallManager = require("AA_HallManager");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
var _property = _decorator.property;

var _def_UI_BoxUpLevel = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.auto_ui = null;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype._show = function (e) {
    var t = this;
    var o = [];
    for (var n = 1; n < arguments.length; n++) {
      o[n - 1] = arguments[n];
    }
    this.ShowLevel(HallManager.HallMgr.shopData.boxLevel);
    this.auto_ui.node_lightNode.stopAllActions();
    this.auto_ui.node_lightNode.runAction(cc.repeatForever(cc.rotateBy(3, 360)));
    this.auto_ui.btn_closeBtn.node.active = false;
    this.scheduleOnce(function () {
      t.auto_ui.btn_closeBtn.node.active = true;
    }, 2);
  };
  _creator.prototype._clickListener = function (e) {
    switch (e) {
      case this.auto_ui.btn_closeBtn:
        this._close();
        this.auto_ui.node_lightNode.stopAllActions();
        this.auto_ui.btn_closeBtn.node.active = false;
    }
  };
  _creator.prototype.ShowLevel = function (e) {
    var t = this.auto_ui;
    t.txt_levelLabel.string = "l" + (e + 1);
    var o = Excel.Excel.shopBoxLevel(e);
    var n = Excel.Excel.shopBoxLevel(e + 1);
    t.txt_box1LvLabel.node.parent.active = n.rewards[0] > 0;
    t.txt_box1LvLabel.string = "+" + (n.rewards[0] - o.rewards[0]);
    t.txt_box1LanLabel.node.parent.active = n.rewards[1] > 0;
    t.txt_box1LanLabel.string = "+" + (n.rewards[1] - o.rewards[1]);
    t.txt_box1ZiLabel.node.parent.active = n.rewards[2] > 0;
    t.txt_box1ZiLabel.string = "+" + (n.rewards[2] - o.rewards[2]);
    t.txt_box2LvLabel.node.parent.active = n.bigRewards[0] > 0;
    t.txt_box2LvLabel.string = "+" + (n.bigRewards[0] - o.bigRewards[0]);
    t.txt_box2LanLabel.node.parent.active = n.bigRewards[1] > 0;
    t.txt_box2LanLabel.string = "+" + (n.bigRewards[1] - o.bigRewards[1]);
    t.txt_box2ZiLabel.node.parent.active = n.bigRewards[2] > 0;
    t.txt_box2ZiLabel.string = "+" + (n.bigRewards[2] - o.bigRewards[2]);
  };
  __decorate([_property(UI_BoxUpLevel_UIBindings.default)], _creator.prototype, "auto_ui", undefined);
  return __decorate([_ccclass], _creator);
}(UIView.default);
exports.default = _def_UI_BoxUpLevel;